package com.ruoyi.crm.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.crm.mapper.ServiceCustomerMapper;
import com.ruoyi.crm.domain.ServiceCustomer;
import com.ruoyi.crm.service.IServiceCustomerService;

/**
 * 客户服务单Service业务层处理
 *
 * @author ruoyi
 * @date 2021-08-30
 */
@Service
public class ServiceCustomerServiceImpl implements IServiceCustomerService
{
    @Autowired
    private ServiceCustomerMapper serviceCustomerMapper;

    /**
     * 查询客户服务单
     *
     * @param id 客户服务单主键
     * @return 客户服务单
     */
    @Override
    public ServiceCustomer selectServiceCustomerById(String id)
    {
        return serviceCustomerMapper.selectServiceCustomerById(id);
    }

    /**
     * 查询客户服务单列表
     *
     * @param serviceCustomer 客户服务单
     * @return 客户服务单
     */
    @Override
    public List<ServiceCustomer> selectServiceCustomerList(ServiceCustomer serviceCustomer)
    {
        return serviceCustomerMapper.selectServiceCustomerList(serviceCustomer);
    }

    /**
     * 新增客户服务单
     *
     * @param serviceCustomer 客户服务单
     * @return 结果
     */
    @Override
    public int insertServiceCustomer(ServiceCustomer serviceCustomer)
    {
        return serviceCustomerMapper.insertServiceCustomer(serviceCustomer);
    }

    /**
     * 修改客户服务单
     *
     * @param serviceCustomer 客户服务单
     * @return 结果
     */
    @Override
    public int updateServiceCustomer(ServiceCustomer serviceCustomer)
    {
        return serviceCustomerMapper.updateServiceCustomer(serviceCustomer);
    }

    /**
     * 批量删除客户服务单
     *
     * @param ids 需要删除的客户服务单主键
     * @return 结果
     */
    @Override
    public int deleteServiceCustomerByIds(String[] ids)
    {
        return serviceCustomerMapper.deleteServiceCustomerByIds(ids);
    }

    /**
     * 删除客户服务单信息
     *
     * @param id 客户服务单主键
     * @return 结果
     */
    @Override
    public int deleteServiceCustomerById(String id)
    {
        return serviceCustomerMapper.deleteServiceCustomerById(id);
    }

    @Override
    public ServiceCustomer getInfoByServiceNo(String serviceNo) {
        return serviceCustomerMapper.getInfoByServiceNo(serviceNo);
    }

    @Override
    public List<ServiceCustomer> getServiceInfoByCustomerName(String customerName) {
        return serviceCustomerMapper.getServiceInfoByCustomerName(customerName);
    }
}